@layout("/common/default.html",{title:'添加',libs:['form']}){
<!--form表单-->
<form class="layui-form"  lay-filter="layui-form-user" id="layui-form-user">
    <input type="hidden" id="onlyid" name="id" value="${user.id}">
    <input type="hidden" id="op" name="op" value="${user.op}">
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-header">基本信息</div>
            <div class="layui-card-body">
                <div class="layui-form-item layui-row">
                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block">
                            <input type="text"  value="${user.name!}"  lay-verify="required" placeholder="请输入菜单名"
                                   autocomplete="off" class="layui-input" disabled>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">登录名</label>
                        <div class="layui-input-block">
                            <input type="text"  value="${user.loginName!}" lay-verify="" placeholder="请输入链接"
                                   autocomplete="off" class="layui-input" disabled>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">手机号码</label>
                        <div class="layui-input-block">
                            <input type="text"  value="${user.mobile!}"  lay-verify="" placeholder="请输入图标"
                                   autocomplete="off" class="layui-input" disabled>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">电话</label>
                        <div class="layui-input-block">
                            <input type="text"   value="${user.phone!}" lay-verify="" placeholder="请输入链接"
                                   autocomplete="off" class="layui-input" disabled>
                        </div>
                    </div>


                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">邮箱</label>
                        <div class="layui-input-block">
                            <input type="text"   value="${user.email!}" lay-verify="" placeholder="请输入链接"
                                   autocomplete="off" class="layui-input" disabled>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">所属部门</label>
                        <div class="layui-input-block">
                            <input type="text"  placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required" required="" disabled>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">用户类型</label>
                        <div class="layui-input-block">
                            <#select path="userType" value="${user.userType!}" items="${fnc.getDictList('sys_user_type')}" placeholder="请选择" disabled="disabled"/>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">职务</label>
                        <div class="layui-input-block">
                            <input type="text"    value="${user.job!}" lay-verify="" placeholder="请输入链接"
                                   autocomplete="off" class="layui-input" disabled>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9" >
                        <label class="layui-form-label" >是否允许登陆</label>
                        <div class="layui-input-block">
                            <input type="radio" name="loginFlag" value="1" title="启用" lay-filter="userFlag" checked disabled><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>是</div></div>
                            <input type="radio" name="loginFlag" value="0" title="停用" lay-filter="userFlag" disabled><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>否</div></div>
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label">选择角色</label>
                        <div class="layui-input-block">
                            @for(item in allRoles){
                            <input type="radio" name="roles" value="${item.id!}" title="${item.name}" disabled>
                            @}
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <div class="form-group-bottom" style="z-index: 200" align="center">
        <button   id="btnclose" class="layui-btn layui-btn-primary"  >&emsp;取消&emsp;</button>
    </div>
    </div>
</form>
<!--js逻辑-->
<script>

    var groupCheckbox = $("input[name='roles']");
    @if(isNotEmpty(user.roleList)){
    @for(role in user.roleList){
            var value = '${role.id}';
            for (i = 0; i < groupCheckbox.length; i++) {
                if (groupCheckbox[i].value == value) {
                    groupCheckbox[i].checked=true;
                }
            }
        @}
    @}

    layui.use(['form', 'utils', 'resAjax','openLayer','treeSelect'], function () {
        var $ = layui.$,
            form = layui.form,
            utils = layui.utils,
            treeSelect = layui.treeSelect,
            openLayer = layui.openLayer,
            resAjax =layui.resAjax;




        treeSelect.render({
            elem: '#office',
            title: '部门选择',
            type: '1',
            icon:'layui-icon layui-icon-share',
            value:'${user.office.id!}',
            label:'${user.office.name!}'
        });







    });

</script>
@}
